import { Module, Global } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AccessEntity } from './model/admin/system/access.entity';
import { AccountRoleEntity } from './model/admin/system/account_role.entity';
import { AccountEntity } from './model/admin/system/account.entity';
import { DictConfigEntry } from './model/admin/system/dict.config.entity';
import { RoleAccessEntity } from './model/admin/system/role_access.entity';
import { RoleEntity } from './model/admin/system/role.entity';

const entityList = [
  AccessEntity,
  AccountRoleEntity,
  AccountEntity,
  DictConfigEntry,
  RoleAccessEntity,
  RoleEntity,
];

@Global()
@Module({
  imports: [
    TypeOrmModule.forFeature(entityList),
  ],
  exports: [
    TypeOrmModule.forFeature(entityList),
  ],
})
export class EntitiesModule { }
